<template>
	<view class="zg-area">
		<!-- 导航 -->
		<view class="area-nav">
			<image src="/pagesShop/static/shop_bg.png" mode=""></image>
			<view class="area-nav-content" :style="{'padding-top': statusbar_height + 'px'}">
				<view class="nav">
					<view class="nav-left" @click="back" v-if="isRoutes">
						<image src="/pagesShop/static/left.svg" mode=""></image>
					</view>
					<view class="center_combo tp-h100 tp-ml20" style="width: 60rpx;" v-else>
						<uni-icons class="" type="home" size="24" color="#fff" @click="pageJumps('/pages/tabbar/home', true)"></uni-icons>
					</view>
					<view class="nav-center">
						<input type="text" placeholder="商品/关键词" v-model="keyword">
						<image src="/pagesShop/static/search2.png" mode=""></image>
					</view>
					<view class="nav-right"></view>
				</view>
				<!-- 店铺信息 -->
				<view class="shop-info">
					<view class="shop-info-l">
						<view class="shop-info-img">
							<image :src="`${shopImgUrl}${details.scCover}`" mode="aspectFill"></image>
						</view>
						<view class="shop-info-content">
							<view class="shop-info-row1">
								<view class="shop-info-row1-l">
									<text>{{details.scName || '店铺名称'}}</text>
								</view>
								<view class="shop-info-row1-r" @click="goRouter2">
									<text>查看</text>
									<image src="/pagesShop/static/more.png" mode="widthFix"></image>
								</view>
							</view>
							<view class="shop-info-row2">
								<text>销量：{{handleSales(details.scSales)}}</text>
								<text>评分：{{details.scScore || 0}}分</text>
							</view>
						</view>
					</view>
					<view class="shop-info-r">
						<view class="shop-info-r-item" @click="action1">
							<image src="/pagesShop/static/si1.png" mode="widthFix"></image>
							<text>客服</text>
						</view>
						<view class="shop-info-r-item" @click="action2">
							<image v-if="isCon === '1'" src="/pagesShop/static/si2.png" mode="widthFix"></image>
							<image v-else src="/pagesShop/static/start2.png" mode="widthFix"></image>
							<text>收藏</text>
						</view>
						<!-- #ifdef MP-WEIXIN -->
						<button class="shop-info-r-item" open-type="share">
							<image src="/pagesShop/static/si3.png" mode="widthFix"></image>
							<text>分享</text>
						</button>
						<!-- #endif -->
					</view>
				</view>
			</view>
		</view>
		<!-- 内容 首页 S -->
		<view class="home-content tp-pd30" v-if="pageType == 0">
			<jyf-parser :html="details.scDescription || ''" ref="article"></jyf-parser>
		</view>
		<!-- 内容 首页 E -->
		<!-- 内容 全部商品 S -->
		<view class="fixed-tool-top" v-if="pageType == 1">
			<!-- 筛选 -->
			<view class="sx">
				<scroll-view scroll-x style="height: 40px">
					<view class="sx-box">
						<view class="sx-box-item" :class="{active: currentIndex3 === 0}" @click="changeTab3(0)">
							<text>综合</text>
						</view>
						<view class="sx-box-item" :class="{active: currentIndex3 === 1}" @click="changeTab3(1)">
							<text>销量</text>
							<!-- <view class="sx-box-icon">
								<template v-if="currentIndex3 === 1">
									<image src="/pagesShop/static/sf2-1.png" mode="widthFix"></image>
									<image src="/pagesShop/static/sf1-1.png" mode="widthFix"></image>
								</template>
								<template v-else>
									<image src="/pagesShop/static/sf2.png" mode="widthFix"></image>
									<image src="/pagesShop/static/sf1.png" mode="widthFix"></image>
								</template>
							</view> -->
						</view>
						<view class="sx-box-item" :class="{active: currentIndex3 === 2}" @click="changeTab3(2)">
							<text>价格</text>
							<view class="sx-box-icon">
								<template v-if="currentIndex3 === 2">
									<template v-if="sortx === 1">
										<image src="/pagesShop/static/sf2.png" mode="widthFix"></image>
										<image src="/pagesShop/static/sf1-1.png" mode="widthFix"></image>
									</template>
									<template v-else>
										<image src="/pagesShop/static/sf2-1.png" mode="widthFix"></image>
										<image src="/pagesShop/static/sf1.png" mode="widthFix"></image>
									</template>
								</template>
								<template v-else>
									<image src="/pagesShop/static/sf2.png" mode="widthFix"></image>
									<image src="/pagesShop/static/sf1.png" mode="widthFix"></image>
								</template>
							</view>
						</view>
						<view class="sx-box-item" :class="{active: currentIndex3 === 3}" @click="changeTab3(3)">
							<text>新品</text>
							<!-- <view class="sx-box-icon">
								<template v-if="currentIndex3 === 3">
									<image src="/pagesShop/static/sf2-1.png" mode="widthFix"></image>
									<image src="/pagesShop/static/sf1-1.png" mode="widthFix"></image>
								</template>
								<template v-else>
									<image src="/pagesShop/static/sf2.png" mode="widthFix"></image>
									<image src="/pagesShop/static/sf1.png" mode="widthFix"></image>
								</template>
							</view> -->
						</view>
						<view class="sx-box-item" @click="changeTab4(row_type)">
							<image v-if="row_type === 'row'" src="/pagesShop/static/f1.png" mode="widthFix"></image>
							<image v-else src="/pagesShop/static/f2.png" mode="widthFix"></image>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
		<!-- 内容 -->
		<view class="content" v-if="pageType == 1">
			<view class="area-1" v-if="list.length > 0">
				<view v-if="row_type === 'row'">
					<view class="card" v-for="(item,index) in list" :key="index" @click="goRouter1(item)">
						<view class="card-left">
							<image :src="`${shopImgUrl}${item.pic}`" mode="aspectFill"></image>
						</view>
						<view class="card-right">
							<view class="card-title">
								{{item.name || ''}}
							</view>
							<view class="card-info">
								<view class="card-price flex align_baseline">
									<text class="flex align_baseline tp-fz22">￥ <text class="tp-fz36">{{item.price || 0}}</text></text>
									<!-- <text>￥{{item.discountPrice || 0}}</text> -->
								</view>
								<view class="card-xl">
									销量 {{ handleSales(item.sale) }}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="card-wapper" v-else>
					<view class="card" v-for="(item,index) in list" :key="index" @click="goRouter1(item)">
						<view class="card-top">
							<image :src="`${shopImgUrl}${item.pic}`" mode="aspectFill"></image>
						</view>
						<view class="card-bottom">
							<view class="card-title">
								{{item.name || ''}}
							</view>
							<view class="card-info">
								<view class="card-price flex align_baseline">
									<text class="flex align_baseline tp-fz22">￥ <text class="tp-fz36">{{item.price || 0}}</text></text>
									<!-- <text>￥{{item.discountPrice || 0}}</text> -->
								</view>
								<view class="card-xl">
									销量 {{handleSales(item.sale)}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<uni-load-more color="#999" :status="status" v-if="list.length > 0"></uni-load-more>
			</view>
			<view class="nomore" v-if="list.length === 0 && !loading">
				<view class="nomore-text">
					<image src="/pagesShop/static/zanwu.png" mode="widthFix"></image>
					<view>暂无数据</view>
				</view>
			</view>
		</view>
		<!-- 内容 全部商品 E -->
		<!-- 内容 优惠券 S -->
		<view class="coupon-content" v-if="pageType == 2 ">
			<view class="area-1" v-if="list.length > 0">
				<view class="sp-a">
					<view class="sp-a2-content">
						<view class="sp-a2-row" v-for="(item,index) in list" :key="index">
							<view class="sp-a2-left">
								<view class="sp-a2-price">
									<text>￥</text>
									<text>{{item.amount || 0}}</text>
								</view>
								<view class="sp-a2-type">
									<view v-if="item.type === '1'" @click="action0(item)">立即领取</view>
									<text v-else>已领取</text>
								</view>
							</view>
							<view class="sp-a2-right">
								<view class="sp-a2-info1">
									满{{item.fullAmount}}减{{item.amount || 0}}
								</view>
								<view class="sp-a2-info2">
									有效期：{{item.startTime}} — {{item.endTime}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="nomore" v-else>
				<view class="nomore-text">
					<image src="/pagesShop/static/zanwu.png" mode="widthFix"></image>
					<view>暂无数据</view>
				</view>
			</view>
		</view>
		<!-- 内容 优惠券 E -->
		<!-- 内容 分类 S -->
		<view class="stab" :style="{height: height + 'px'}" v-if="pageType == 3">
			<view class="stab-title">
				<scroll-view scroll-y>
					<view class="nav-list">
						<view class="nav-list-item1" :class="{active: currentIndex1 === index}" v-for="(item,index) in nav1" :key="index" @click="changeTab1(index)">
							{{item.name}}
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="stab-content">
				<scroll-view scroll-y>
					<view class="nav-list">
						<view class="nav-list-item2" :class="{active: currentIndex2 === index}" v-for="(item,index) in nav2" :key="index" @click="changeTab2(index)">
							{{item.name}}
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
		<!-- 内容 分类 E -->
		<!-- tab -->
		<view class="area-tab">
			<view class="area-tab-item" :class="{active: pageType == 0}"  @click="changeTab6(0)">
				<image v-if="pageType != 0" src="/pagesShop/static/index1.png" mode="widthFix"></image>
				<image  v-if="pageType == 0" src="/pagesShop/static/index1-1.png" mode="widthFix"></image>
				<text>首页</text>
			</view>
			<view class="area-tab-item" :class="{active: pageType == 1}" @click="changeTab6(1)">
				<image  v-if="pageType != 1" src="/pagesShop/static/index2.png" mode="widthFix"></image>
				<image  v-if="pageType == 1" src="/pagesShop/static/index2-1.png" mode="widthFix"></image>
				<text>全部商品</text>
			</view>
			<view class="area-tab-item" :class="{active: pageType == 2}"  @click="changeTab6(2)">
				<image  v-if="pageType != 2" src="/pagesShop/static/index3.png" mode="widthFix"></image>
				<image  v-if="pageType == 2" src="/pagesShop/static/index3-1.png" mode="widthFix"></image>
				<text>优惠券</text>
			</view>
			<view class="area-tab-item" :class="{active: pageType == 3}"  @click="changeTab6(3)">
				<image  v-if="pageType != 3" src="/pagesShop/static/index4.png" mode="aspectFill"></image>
				<image  v-if="pageType == 3" src="/pagesShop/static/index4-1.png" mode="aspectFill"></image>
				<text>商品分类</text>
			</view>
		</view>
	</view>
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
	export default {
		components: {
			jyfParser
		},
		data() {
			return {
				pageType: 0, // 页面显示 0 首页 1 全部商品 2 优惠券 3 商品分类

				row_type: 'table',
				currentIndex3: 0,
				keyword: '',
				sid: '',
				isCon: '1',
				details: {},
				page: 1,
				status: 'more',
				loading: false,
				list: [],
				
				sortx: 1,
				
				nav1: [],
				nav2: [],
				height: 0,
				currentIndex1: 0,
				currentIndex2: 0,
				
				isRoutes: true, //  有上页 ，不是直接进的详情页
			}
		},
		watch: {
			keyword() {
				this.getList1()
			}
		},
		onLoad(params) {
			console.log(params);
			this.sid = params.sid || ''
			this.keyword = params.keyword || ''
			if (this.sid) {
				this.getDetails1()
				this.getDetails2()
			}
			this.height = uni.getSystemInfoSync().windowHeight -  uni.getSystemInfoSync().statusBarHeight - 50
			
			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
			if (routes.length == 1) {
				this.isRoutes = false
			} else {
				this.isRoutes = true
			}
		},
		onPullDownRefresh() {
			if(this.pageType == 0){
				this.getDetails1()
				this.getDetails2()
			}else  if(this.pageType == 1){
				this.getList1()
			}else if(this.pageType == 2){
				this.getShopShop3() // 优惠券
			}else if(this.pageType == 3){
				this.getShopShop5() // 分类
			}
		},
		onReachBottom() {
			this.getList1_1()
		},
		onShareAppMessage(res) {
			return {
				title: this.details.scName,
				path: '/pagesShop/shop/index1?sid=' + this.sid + '&inviteCode=' + this.getCustomerInfo.inviteCode,
				imageUrl: this.shopImgUrl + this.details.scCover,
				success(res) {
					uni.showToast({
						title: '分享成功'
					})
				},
				fail(res) {
					uni.showToast({
						title: '分享失败',
						icon: 'none'
					})
				}
			}
		},

		methods: {
			changeTab1(index) {
				this.currentIndex1 = index
				this.nav2 = this.nav1[index] ? this.nav1[index].mallProductCategories : []
			},
			changeTab2(index) {
				this.currentIndex2 = index
				uni.navigateTo({
					url: `../list/list?nav1_id=${this.nav1[this.currentIndex1].id}&nav2_id=${this.nav2[index].id}&shopId=${this.sid}`
				})
			},
			// 获取分类
			getShopShop5() {
				this.$http.post(this.$api.shop_shop_5, {}, {
					params: {
						id: this.sid,
					}
				}).then(res => {
					uni.stopPullDownRefresh()
					if(res.code === 200) {
						this.nav1 = res.data
						if(this.nav1.length > 0) {
							this.changeTab1(0)
						}
					} else {
						this.nav1 = []
					}
				}).catch(() => {
					this.nav1 = []
				})
			},
			// 店铺优惠券列表
			getShopShop3() {
				this.$http.post(this.$api.shop_shop_3, {}, {
					params: {
						shopId: this.sid,
					}
				}).then(res => {
					uni.stopPullDownRefresh()
					if (res.code === 200) {
						this.list = res.data
					} else {
						this.list = []
					}
				}).catch(() => {
					this.list = []
				})
			},
			// 领取优惠券接口
			action0(item) {
				this.$http.post(this.$api.shop_details_2, {}, {
					params: {
						id: item.id, // 优惠券id
					}
				}).then(result => {
					uni.showToast({
						title: result.msg,
						icon: 'none'
					})
					if (result.code === 200) {
						this.getShopShop3()
					}
				})
			},
			// 去商品详情
			goRouter1(item) {
				if (Object.prototype.toString.call(item) === '[object Object]' && typeof item.id === 'string' && item.id !== '') {
					uni.navigateTo({
						url: `../details/details?cid=${item.id}`
					});
				} else {
					console.error("商品id错误", item.id);
				}
			},
			// 去商铺详情
			goRouter2() {
				uni.navigateTo({
					url: `../details/shop_details?sid=${this.sid}`
				})
			},
			// 店铺详情
			getDetails1() {
				this.$http.post(this.$api.shop_shop_1, {}, {
					params: {
						id: this.sid
					}
				}).then(res => {
					uni.stopPullDownRefresh()
					if (res.code === 200) {
						this.details = res.data
					} else {
						this.details = {}
					}
				}).catch(() => {
					this.details = {}
				})
			},
			// 根据用户和商品店铺id查询是否收藏
			getDetails2() {
				this.$http.post(this.$api.shop_list_8, {}, {
					params: {
						id: this.sid,
						type: 1
					}
				}).then(res => {
					if (res.code === 200) {
						this.isCon = res.data.status
					} else {
						this.isCon = "1"
					}
				}).catch(() => {
					this.isCon = "1"
				})
			},
			// 获取商品
			getList1() {
				this.page = 1;
				this.status = 'more'
				this.loading = true
				this.$http.post(this.$api.shop_shop_4, {}, {
					params: {
						pageNum: this.page,
						shopId: this.sid,
						keyword: this.keyword,
						status: this.currentIndex3,
						sort: this.sortx,
						categoryId: '',
						floorPrice: '',
						highPrice: '',
						praiseRate: '', // 好评率
					}
				}).then(res => {
					uni.stopPullDownRefresh()
					this.loading = false
					if (res.code === 200) {
						this.list = res.data.result
						if (res.data.length < 10) {
							this.status = 'noMore'
						}
					} else {
						this.list = []
						this.status = 'more'
					}
				}).catch(() => {
					this.loading = false
					this.list = []
					this.status = 'more'
				})
			},
			// 根据条件查询商品
			getList1_1() {
				if (this.status === 'noMore') return
				this.page++
				this.status = 'loading'
				this.$http.post(this.$api.shop_shop_4, {}, {
					params: {
						pageNum: this.page,
						shopId: this.sid,
						keyword: this.keyword,
						status: this.currentIndex3,
						sort: this.sortx,
						categoryId: '',
						floorPrice: '',
						highPrice: '',
						praiseRate: '', // 好评率
					}
				}).then(result => {
					if (result.code === 200) {
						const list = result.data.result;
						if (Array.isArray(list)) {
							if (list.length > 0) {
								this.list = this.list.concat(list);
							} else {
								this.status = 'noMore'
							}
						} else {
							this.status = 'more'
						}
					}
				}).catch(() => {
					this.status = 'more'
				})
			},
			action1() {
				if (this.details.scPhone) {
					uni.makePhoneCall({
						phoneNumber: this.details.scPhone
					})
				} else {
					uni.showToast({
						title: '暂无客服电话',
						icon: 'none'
					})
				}
			},
			// 收藏
			action2() {
				this.$http.get(this.$api.shop_shop_2, {
					scId: this.sid
				}).then(res => {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					if (res.code === 200) {
						this.getDetails2()
					}
				})
			},
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			changeTab3(index) {
				this.currentIndex3 = index
				if (index === 2) this.sortx = this.sortx === 1 ? 0 : 1
				this.getList1()
			},
			changeTab4(row_type) {
				this.row_type = row_type === 'row' ? 'table' : 'row'
			},
			// 切换底部
			changeTab6(index) {
				this.pageType = index
				if(this.pageType == 0){
					this.getDetails1()
					this.getDetails2()
				}else  if(this.pageType == 1){
					this.getList1()
				}else if(this.pageType == 2){
					this.getShopShop3() // 优惠券
				}else if(this.pageType == 3){
					this.getShopShop5() // 分类
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.area-nav {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 153px;
		padding-top: 0 !important;
	}

	.area-nav-content {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 100%;
		padding-top: var(--status-bar-height);
		box-sizing: border-box;
	}

	.nav {
		background-color: transparent !important;
	}

	.shop-info {
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: #fff;
		margin-top: 20rpx;
		padding: 0 30rpx;
	}

	.shop-info-l {
		display: flex;
		align-items: center;
		flex-grow: 1;
	}

	.shop-info-img {
		width: 82rpx;
		height: 82rpx;
		margin-right: 30rpx;

		image {
			width: 82rpx;
			height: 82rpx;
			border-radius: 8rpx;
		}
	}

	.shop-info-content {
		flex-grow: 1;
		margin-right: 10rpx;
	}

	.shop-info-row1 {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 10rpx;
	}

	.shop-info-row1-l {
		font-size: 30rpx;
		width: 240rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.shop-info-row1-r {
		flex-shrink: 0;

		image {
			width: 20rpx;
			height: auto;
			margin-left: 10rpx;
		}
	}

	.shop-info-row2 {
		font-size: 24rpx;

		text {
			margin-right: 30rpx;
		}
	}

	.shop-info-r {
		display: flex;
	}

	.shop-info-r-item {
		width: 80rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: flex-end;
		background-color: transparent;
		color: #fff;
		font-size: 24rpx;

		image {
			width: 50rpx;
			height: auto;
			margin-bottom: 10rpx;
		}
	}

	.area-tab {
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 50px;
		background-color: #fff;
		display: flex;
		justify-content: space-around;
	}

	.area-tab-item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		font-size: 24rpx;
		color: #666;

		image {
			width: 50rpx;
			height: 50rpx;
		}

		&.active {
			color: $blue;
		}
	}

	.filter-selects {
		display: flex;
		flex-wrap: wrap;
	}

	.filter-select {
		background-color: #ebebeb;
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: #999;
		width: 200rpx;
		height: 60rpx;
		padding: 0 20rpx;
		margin: 0 20rpx 20rpx 0;

		image {
			width: 20rpx;
			height: auto;
		}
	}

	.filter-inputs {
		display: flex;
		align-items: center;

		input {
			background-color: #ebebeb;
			height: 80rpx;
			border-radius: 40rpx;
			text-align: center;
			font-size: 30rpx;
		}

		text {
			margin: 0 10rpx;
			color: #ccc;
		}
	}

	.filter-tags {
		display: flex;
		flex-wrap: wrap;
	}

	.filter-tag {
		border: 1px solid #ddd;
		font-size: 26rpx;
		padding: 5rpx 10rpx;
		flex-shrink: 0;
		margin: 0 20rpx 20rpx 0;
		border-radius: 4rpx;

		&.active {
			background-color: $uni-color-error;
			color: #fff;
			border: 0;
		}
	}


	.nav-center {
		text-align: left !important;
		padding: 0 !important;
		position: relative;

		input {
			width: 450rpx;
			background-color: #fff;
			color: #333;
			height: 30px;
			border-radius: 30px;
			box-sizing: border-box;
			padding: 0 20rpx 0 70rpx;
			font-size: 26rpx;
		}

		image {
			width: 16px;
			height: 16px;
			position: absolute;
			left: 12px;
			top: 8px;
		}
	}

	.card-info-right {
		display: flex;

		&>view {
			margin-left: 10rpx;
		}
	}

	.card {
		margin: 30rpx;
		padding: 20rpx;
		background-color: #fff;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
	}

	.card-left {
		flex-shrink: 0;
		width: 180rpx;
		height: 180rpx;
		overflow: hidden;
		margin-right: 20rpx;

		image {
			width: 180rpx;
			height: 180rpx;
		}
	}

	.card-right {
		flex-grow: 1;
	}

	.card-title {
		font-size: 28rpx;
	}

	.card-info {
		margin-top: 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.card-price {
		text {
			&:nth-of-type(1) {
				color: $uni-color-error;
				// font-size: 36rpx;
				font-weight: bold;
			}

			&:nth-of-type(2) {
				margin-left: 10rpx;
				color: #999;
				text-decoration: line-through;
			}
		}
	}

	.card-xl {
		font-size: 24rpx;
		color: #999;
	}

	.card-tools {
		margin-top: 10rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.card-time {
		margin-top: 20rpx;
		color: $uni-color-error;
		font-size: 24rpx;
	}

	.card-wapper {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		margin: 30rpx;

		.card {
			margin: 0 0 30rpx;
			padding: 0;
			flex-direction: column;
			width: 330rpx;
		}

		.card-tools {
			flex-direction: column;
			align-items: flex-start;
			margin-bottom: 10rpx;
		}

		.card-info {
			margin-top: 10rpx;
		}

		.card-time {
			margin-top: 10rpx;
		}
	}

	.card-top {
		width: 330rpx;
		height: 330rpx;
	}

	.card-bottom {
		padding: 10rpx;
		width: 100%;
		box-sizing: border-box;
	}

	.fl1,
	.fl2 {
		border-bottom: 1px solid #eee;
		box-sizing: border-box;
	}

	.fltab {
		height: 100%;
		display: flex;
	}

	.fltab-item {
		display: flex;
		align-items: center;
		flex-shrink: 0;
		height: 100%;
		font-size: 26rpx;
		padding: 0 20rpx;
		position: relative;

		&.active {
			color: $blue;

			&::after {
				display: block;
			}
		}
	}

	.fltab-item1 {
		&::after {
			content: "";
			display: none;
			position: absolute;
			bottom: 0;
			left: 50%;
			margin-left: -0.5em;
			width: 1em;
			height: 6rpx;
			background-color: $blue;
		}

		&.active {
			&::after {
				display: block;
			}
		}
	}

	.sx-box {
		height: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.sx-box-item {
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-grow: 1;

		&>image {
			width: 36rpx;
			height: auto;
		}

		&.active {
			color: $blue;
		}
	}

	.sx-box-icon {
		width: 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: flex-end;

		image {
			width: 20rpx;
			height: auto;

			&:nth-of-type(1) {
				margin-bottom: 4rpx;
			}
		}

		.sbi1 {
			width: 25rpx;
		}
	}

	.fixed-tool-top {
		position: fixed;
		top: 153px;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 40px;
		box-sizing: border-box;
		background-color: #fff;
	}

	.sx-box {
		height: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.sx-box-item {
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-grow: 1;

		&>image {
			width: 36rpx;
			height: auto;
		}

		&.active {
			color: $blue;
		}
	}

	.sx-box-icon {
		width: 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: flex-end;

		image {
			width: 20rpx;
			height: auto;

			&:nth-of-type(1) {
				margin-bottom: 4rpx;
			}
		}
	}

	// 全部商品 E
	.content {
		padding: 193px 0 50px;
	}

	// 首页
	.home-content {
		padding: 168px 30rpx 65px;
	}

	// /////////////////////////////////// 优惠券
	.coupon-content {
		padding: 153px 0 0;
	}

	.sp-a2-content {
		padding: 10rpx 0;
	}

	.sp-a2-row {
		display: flex;
		align-items: center;
		background-color: #fffaf7;

		&:not(:nth-last-of-type(1)) {
			margin-bottom: 20rpx;
		}
	}

	.sp-a2-left {
		width: 200rpx;
		height: 190rpx;
		margin-right: 30rpx;
		background-color: #ff660a;
		color: #fff;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.sp-a2-price {
		margin-bottom: 20rpx;

		text {
			&:nth-of-type(1) {
				font-size: 32rpx;
			}

			&:nth-of-type(2) {
				font-size: 50rpx;
			}
		}
	}

	.sp-a2-type {
		font-size: 24rpx;

		text {
			display: block;
			padding: 8rpx 30rpx;
		}

		view {
			border: 1px solid #fff;
			padding: 8rpx 30rpx;
			border-radius: 40rpx;
			box-sizing: border-box;
		}
	}

	.sp-a2-right {}

	.sp-a2-info1 {
		font-size: 28rpx;
		margin-bottom: 20rpx;
	}

	.sp-a2-info2 {
		font-size: 24rpx;
		color: #666;
	}

	.sp-a-4 {
		padding: 30rpx;

		button {
			background-color: $uni-color-error;
			color: #fff;
			height: 88rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 44px;
		}
	}

	.sp-a {
		padding: 30rpx;
		border-radius: 20px 20px 0px 0px;
		position: relative;
	}

	.sp-a-close {
		position: absolute;
		right: 20rpx;
		top: 20rpx;
		width: 40rpx;
		height: 40rpx;
	}
	// 优惠券E
	// 分类 S
	.stab {
		flex-grow: 1;
		display: flex;
		padding-top: 153px;
		box-sizing: border-box;
		height: 464px;
	}
	
	.stab-title {
		flex-shrink: 0;
		width: 260rpx;
		height: 100%;
		background-color: #f5f5f5;
		
		scroll-view {
			height: 100%;
		}
	}
	
	.stab-content {
		flex-grow: 1;
		height: 100%;
		background-color: #fff;
		
		scroll-view {
			height: 100%;
		}
	}
	
	.nav-list {
		
	}
	
	.nav-list-item1 {
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 30rpx;
		
		&.active {
			background-color: #fff;
			color: $blue;
		}
	}
	
	.nav-list-item2 {
		height: 80rpx;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		box-sizing: border-box;
		padding: 0 60rpx;
		font-size: 30rpx;
		
		&.active {
			background-color: #fff;
			color: $blue;
		}
	}
	// 分类E
</style>
